/*api接口管理*/
import axios, { ResponseData } from './index'
import { AxiosPromise } from 'axios'
interface CategoryParams{
    action: string;
    consumeType:number;
    platform: number;
    deviceType: string;
    deviceVersion: string;
    channelId:number;
    platformSource: string;
    fromPaltform: string;
    deviceSerialNo: string;
    clientVersionNo: string;
    epubID:string;
    token?: any;
    wordSize: number;
    style: number;
}
interface BookParams{
    action:string
    epubID:string
    consumeType:number
    platform:number
    deviceType:string
    deviceVersion:string
    channelId:number
    platformSource:string
    fromPaltform:string
    deviceSerialNo:string
    clientVersionNo:string
    token:string
    chapterID:number
    pageIndex:number
    locationIndex:number
    wordSize:number
    style:number
    autoBuy:number
    chapterIndex:string
}
/*获取当前图书的目录，为get请求*/
export const getLib=(params:CategoryParams): AxiosPromise<ResponseData> =>{
    return axios.request({
        url: '/api.go',
        params,
        method: 'GET'
    })
}
/*获取当前页的内容，为get请求*/
export const getBooks=(params:BookParams):AxiosPromise<ResponseData>=>{
    return axios.request({
        url: '/api.go',
        params,
        method: 'GET'
    })
}